﻿using System;
using System.Collections.Generic;
using System.Text;
using ExpressionUtil.Parser;
using ExpressionUtil.Node.Common;
using ExpressionUtil.Common;
using System.Diagnostics;

namespace ExpressionUtil.Node
{
    /// <summary>
    /// 逗号运算节点（当前没有把逗号作为元算符，而是在CommaHandler中做了特殊处理）
    /// </summary>
    internal class CommaNode : Common.Node
    {
        /// <summary>
        /// 执行节点运算
        /// </summary>
        /// <param name="context">执行参数</param>
        /// <returns>执行结果的类型</returns>
        public override ExecuteRunTimeType Execute(ExecuteContext context)
        {
            throw new NotSupportedException("Comma don't need execute.");
        }

        /// <summary>
        /// 创建树节点
        /// </summary>
        /// <param name="context">解析参数</param>
        public static void CreateCommaNode(ParseContext context)
        {
        }

#if DEBUG
        protected override void DumpCore()
        {
            Debug.WriteLine("CommaNode.");
        }
#endif
    }
}
